function matchresult=gurobSolve(S,dimS,start)

p = ones(1,dimS);
q = ones(1,dimS);
N = size(S,1);
M =size(S,2);
c = S(:)';
A1 = kron(ones(1,M),speye(N,N));
A2 = kron(speye(M,M),ones(1,M));
A = cat(1,A1,A2);
d = [p q]; 
    clear model;
    model.A = A;
    model.obj=c;
    model.modelsense='max';
    model.rhs=d;
    model.sense='=';
    if nargin==3
    model.start=double(start);
    end
    params.OutputFlag=0;
matchresult=gurobi(model,params);

